package com.clqteam.daoimpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.clqteam.dao.DeleteSupplierDao;
import com.clqteam.util.JDBCutil;

public class DeleteSupplierDaoImpl implements DeleteSupplierDao {
	/**
	 * 删除供应商的信息
	 * @param supId 供应商的id
	 * @return boolean
	 */
	@Override
	public boolean deleteSupplierDaoBySupId(int supId) {
		boolean bl=false;
		StringBuffer sql=new StringBuffer("");
		sql.append(" DELETE FROM s_supplier");
		sql.append(" WHERE s_supplier.supId=?");
		Connection con=JDBCutil.getConnection();
		try {
			PreparedStatement ps=con.prepareStatement(sql.toString());			
			ps.setInt(1, supId);
			int i=ps.executeUpdate();
			if(i>0){
				bl=true;
			}
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return bl;
	}

}
